using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Expenses.Models.Mapping
{
    public class ExpenseRecordMap : EntityTypeConfiguration<ExpenseRecord>
    {
        public ExpenseRecordMap()
        {
            // Primary Key
            this.HasKey(t => t.ExpenseRecordId);

            // Properties
            // Table & Column Mappings
            this.ToTable("ExpenseRecords");
            this.Property(t => t.ExpenseRecordId).HasColumnName("ExpenseRecordId");
            this.Property(t => t.Title).HasColumnName("Title");
            this.Property(t => t.Description).HasColumnName("Description");
        }
    }
}
